﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Microsoft.Practices.Unity;
using Microhard.WeixinMP.Interfaces;
using Microhard.WeixinMP.Models;
using Microhard.Permission.Interface;
using Microhard.Permission.MVCFilter.MVCFilter;
using Microhard.Permission.MVCFilter;
using FluentValidation.Mvc;

namespace Microhard.FMCG.WebUI.Areas.WX.Controllers
{
    public class FeedbackController : MicroHardBaseController<FeedbackModel>
    {
        private ICRMFeedback _op = null;

        [Dependency]
        public ICRMFeedback Dic
        {
            set
            {
                base._repository = value;
                this._op = value;
            }
            get
            {
                return this._op;
            }
        }

        [MVCFilterAtrForReDirect(Order = 9, RedirectActionName = "Succeed", RedirectAreaName = "WX", RedirectControllerName = "Feedback")]
        public override ActionResult SaveCreate([CustomizeValidator(RuleSet = "Insert")]FeedbackModel model, bool continueEditing, Core.DBUtility.ScopeResult scope)
        {
            return base.SaveCreate(model, continueEditing, scope);
        }

        [MVCFilterAtrForWeixinMP]
        public ActionResult Succeed()
        {
            return View();
        }
    }
}
